import instance from '@/utils/request'
import { GET_USER_INFO } from '../constants'

/**
 * 获取个人信息
 * @returns
 */
export const getUserInfo = () => {
  return async (dispatch) => {
    const res = await instance.get('/user/profile')
    // console.log('个人信息', res)
    dispatch({
      type: GET_USER_INFO,
      payload: res.data.data,
    })
  }
}
